/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dca.sistemascontrole.handler;

import java.util.concurrent.locks.ReentrantLock;

/**
 *
 * @author Rafael
 */
public class HandlerPainelMalhaVisível {

    public static final int NENHUMA_MALHA = -1;
    public static final int MALHA_ABERTA = 0;
    public static final int MALHA_FECHADA = 1;
    
    private static int malhaAtual = NENHUMA_MALHA;
    private static ReentrantLock lock = new ReentrantLock();

    public static int getMalhaAtual() {
        lock.lock();
        try {
            return malhaAtual;
        } finally {
            lock.unlock();
        }
    }

    public static void setMalhaAtual(int malha) {
        lock.lock();
        try {
            malhaAtual = malha;
        } finally {
            lock.unlock();
        }
    }
}
